package com.session03.homework;

import java.util.HashSet;
import java.util.Set;

public class BallSet {
    //产生一组双色球号码，要求使用Set集合；
    //6红(1-33)1蓝(1-16)
    public static void main(String[] args) {
        Set<Integer> setRed = new HashSet<>();
        while (setRed.size() < 6) {
            int red = (int) (Math.random() * 33 + 1);
            setRed.add(red);
        }

        Set<Integer> setBlue = new HashSet<>();
        int blue = (int) (Math.random() * 16 + 1);
        setBlue.add(blue);

        for (Integer s : setRed) {
            System.out.print(s + " ");
        }
        for (Integer s : setBlue) {
            System.out.println(s);
        }
    }
}
